package com.huangpuweb.task.controller;

import com.alibaba.fastjson.JSONObject;

/**
 * created by Intellij IDEA
 *
 * @author Chengzhifeng
 * @date 2020/5/20
 * @statement
 */
public class Test {

    public static void main(String args[]){

        String str="{\"code\":0,\"msg\":\"OK\",\"timestamp\":1601602765229,\"camera_id\":\"31010112001328035012\",\"gps\":[[31.238958543640337,121.47784263390434,2.8904462829232216],[31.23926313628932,121.47767485963445,2.906297995708883],[31.239139506109645,121.47779662179342,2.8995975526049733],[31.239240671233542,121.47767731685826,2.905166902579367],[31.239073330774012,121.47775541371642,2.896501548588276],[31.238952983108277,121.47783782267919,2.8901933385059237],[31.239106659211114,121.47780307688798,2.89793992228806],[31.239354961191232,121.47764467239605,2.9110249150544405],[31.23934705391631,121.47765967971593,2.91055965796113],[31.239085049395197,121.47781605407349,2.896812044084072],[31.238889128289365,121.47780546358793,2.8871937692165375],[31.239177822511966,121.47774269303623,2.9017415903508663],[31.238887027884022,121.47778824034656,2.887166884727776],[31.239203324579073,121.47777116540017,2.9028819231316447],[31.239351157249228,121.4776524528242,2.9107984378933907],[31.239328643601326,121.4776738076665,2.909573690034449],[31.239248487981833,121.47767705522281,2.905557625927031],[31.238984290378852,121.47779833357495,2.8919104505330324],[31.239478189842895,121.47759552746157,2.9174368754029274],[31.23915528365195,121.4777869923936,2.9004235323518515],[31.239301979639908,121.47768689320091,2.908181168138981],[31.239227954879777,121.47767224941333,2.9045568201690912],[31.23948173050893,121.477614251547,2.917526845820248],[31.23895306387443,121.47778936322274,2.890410921536386],[31.238953782187046,121.47779541557655,2.890419448725879],[31.23888852606189,121.47781514823136,2.8871214417740703],[31.239173472061847,121.47774370566385,2.9015208203345537],[31.23931933505711,121.47764358510116,2.9092482635751367],[31.239465507116034,121.47758443236894,2.91685170866549],[31.238874037494426,121.47780842460384,2.8864393373951316],[31.23930559395512,121.47768093143782,2.908389068208635],[31.238950159126055,121.47782299996982,2.8901192070916295]]}";
        JSONObject jsonObject=JSONObject.parseObject(str);
        Integer length=jsonObject.getJSONArray("gps").size();
        System.out.println(length);
    }
}
